<style>
    .footer-home{display: none}
</style>
<header>
    <a href="index.php?act=member">
        <i class="iconfont icon-xialalan-copy"></i>
    </a>
    <span>我的钱包</span>
</header>
<div class="purse_head margin_bot">
    <p>余额</p>
    <h1>￥<?php echo $output['merchant_info']['all_money']; ?></h1>
    <a href="index.php?act=merchant&op=pd_cash">提现</a>
</div>
<div class="pur_tab">
    <div class="fl <?php  echo $_GET['type']==2?'':'pur_tab_on'; ?>"><a href="index.php?act=merchant&op=wallet">收入</a></div>
    <div class="fl <?php  echo $_GET['type']==2?'pur_tab_on':''; ?>"><a href="index.php?act=merchant&op=wallet&type=2">支出</a></div>
</div>
<div class="pur_detail">
   <?php if($_GET['type']==2){ ?>
       <?php if($output['pd_list']): ?>
    <ul class="pd_ul">
           <?php foreach($output['pd_list'] as $key=> $value){  ?>
        <li>
            <a href="index.php?act=merchant&op=pd_cash_info&pdc_id=<?php echo $value['pdc_id']; ?>">
                <h5>提现<b class="color_red fr">￥<?php echo $value['pdc_amount'] ?></b></h5>
                <?php if($value['pdc_status']==0) {?>
                <p class=" color_red">审核中<b class="fr"><?php echo date('Y-m-d',$value['pdc_add_time']) ?></b></p>
                 <?php  }elseif($value['pdc_status']==1){?>
                    <p class="color_green">已到账<b class="fr"><?php echo date('Y-m-d',$value['pdc_add_time']) ?></b></p>
                   <?php }else{ ?>
                    <p class=" color_red">已拒绝<b class="fr"><?php echo date('Y-m-d',$value['pdc_add_time']) ?></b></p>
                   <?php } ?>
                <i class=" rotate iconfont icon-xialalan-copy"></i>
            </a>
        </li>
        <?php } ?>

    </ul>
       <?php endif; ?>
    <?php }else{ ?>
       <?php if($output['pd_list']): ?>
           <ul class="pd_ul">
               <?php foreach($output['pd_list'] as $key=> $value){  ?>
                   <li>
                       <?php if($value['if_cash']==0){?>
                       <a href="index.php?act=merchant&op=orderdetail&ordersn=<?php echo $value['order_sn']; ?>">
                       <?php }else{?>
                           <a href="index.php?act=merchant&op=pd_cash_info&sn=<?php echo $value['order_sn']; ?>">
                       <?php } ?>
                           <h5><?php echo $value['lg_desc'] ?>，您获得<b class="color_red">￥<?php echo $value['lg_av_amount']; ?></b></h5>
                           <p>订单号：<span><?php echo $value['order_sn'] ?></span><b class="fr"><?php echo date('Y-m-d',$value['lg_add_time']) ?></b></p>
                           <i class=" rotate iconfont icon-xialalan-copy"></i>
                       </a>
                   </li>
               <?php } ?>

           </ul>
       <?php endif; ?>
    <?php } ?>
    <!--加载更多-->
    <div class="load" style="text-align: center;display: none;">
        <div class="loading" style="text-align: center;">正在加载中....</div>
    </div>
</div>
<script>
    //ajax加载分页

    var allNum = <?php echo $output['TotalNum']; ?>,
        allPage = <?php echo $output['TotalPage']; ?>,
        curPage = 1;

    var is_scroll = false;
    $(window).scroll(function () {
        is_scroll = true;
        //已经滚动到上面的页面高度
        var scrollTop = $(this).scrollTop();
        //页面高度
        var scrollHeight = $(document).height();
        //浏览器窗口高度
        var windowHeight = $(this).height();
        //此处是滚动条到底部时候触发的事件，在这里写要加载的数据，或者是拉动滚动条的操作
        if (scrollTop + windowHeight == scrollHeight) {
            $('.load').show();
            loadpage();
        }
    });
    //ajax加载数据
    function loadpage() {
        if(!is_scroll){
            return;
        }
        if (curPage < allPage) {
            curPage += 1;
        } else {
            $('.load').text('没有更多内容了').show();
            return;
        }
        $.get(location.href, {isajax:1,curpage:curPage},function(data){
            if(data){
                $(".pd_ul").append(data);
                $('.load').hide();
            }
        });
    }
</script>